

<h1><?php echo lang('users_all'); ?></h1>


<form method="post" id="form-filter" name='form-user-filter' action="" >
    <fieldset class="ui-widget-content ui-corner-all field_filter">
        <legend class="ui-widget-content ui-corner-all"><?=lang('filter')?></legend>
        <div style='display: block; width: 100%; clear: both; height:30px;'>
          <label><?php echo lang('username');?>:</label>
          <label>E-mail:</label>
          <label><?php echo lang('start_reg_date');?>:</label>
        </div>
        <input type="text" name="filter[username]" id="filter_username" placeholder="<?php echo lang('username');?>" class="text ui-widget-content ui-corner-all" value="<?php if($filter['username']!="") echo $filter['username'] ?>" />
        <input type="text" name="filter[email]" id="filter_email" placeholder="E-mail" class="text ui-widget-content ui-corner-all" value="<?php if($filter['email']!="") echo $filter['email'] ?>"/>
        <input type="text" name="filter[start_reg_date]" id="filter_start_reg_date" placeholder="<?php echo lang('start_reg_date')?>" class="text date_picker ui-widget-content ui-corner-all" value="<?php if($filter['start_reg_date']!="") echo $filter['start_reg_date'] ?>"/>
        
         <select name="filter[gender]" id="filter_gender" class="text ui-widget-content ui-corner-all">
                <option value=""><?php echo lang('gender');?></option>
                <option value="male" <?php if($filter['gender']=='male') echo 'selected'; ?> ><?php echo lang('male');?></option>
                <option value="female" <?php if($filter['gender']=='female') echo 'selected'; ?>><?php echo lang('female');?></option>
         </select>
        <br/>
        <div style='display: block; width: 100%; clear: both; height:28px;'>
          <label>ID:</label>
          <label><?php echo lang('team');?>:</label>
          <label><?php echo lang('end_reg_date');?>:</label>
        </div>
        <input type="text" name="filter[id]" id="filter_id" placeholder="ID" class="text ui-widget-content ui-corner-all"  value="<?php if($filter['id']!="") echo $filter['id'] ?>" />
        
        <select name="filter[team]" id="filter_team" disabled="disabled" class="text ui-widget-content ui-corner-all">
                <option value=""><?php echo lang('team');?></option>
                
         </select>
        
        <input type="text" name="filter[end_reg_date]" id="filter_end_reg_date" placeholder="<?php echo lang('end_reg_date')?>" class="text date_picker ui-widget-content ui-corner-all" value="<?php if($filter['end_reg_date']!="") echo $filter['end_reg_date'] ?>" />
        
        <select name="filter[status]" id="filter_status" class="text ui-widget-content ui-corner-all">
                <option value=""><?php echo lang('status');?></option>
                <option value="1" <?php if($filter['status']=='1') echo 'selected'; ?> ><?php echo lang('normal');?></option>
                <option value="0" <?php if($filter['status']=='0') echo 'selected'; ?> ><?php echo lang('pending');?></option>
                <option value="-1" <?php if($filter['status']=='-1') echo 'selected'; ?> ><?php echo lang('deleted');?></option>
         </select>   
        <br/>
        <!--
        <input type="button" name="filter_submit" id="filter_submit" class="ui-button ui-button-text-only ui-widget ui-state-default ui-corner-all" value="<?php echo lang('search');?>" />
        -->
        <input type="submit" name="filter_submit" id="__filter_submit" class="ui-button ui-button-text-only ui-widget ui-state-default ui-corner-all" value="<?php echo lang('search');?>" />
        <input type="button" name="filter_reset" id="filter_reset" class="ui-button ui-button-text-only ui-widget ui-state-default ui-corner-all" value="<?php echo lang('reset');?>" />
        
    <div style="float: right;"><?=lang('sum_users')?>: <span id="stats"><?php if(isset($stats)) echo $stats; ?></span></div>    
        
    </fieldset>
</form>

<script>
  $("#filter_end_reg_date").datepicker( "setDate", "2013-05-05" );
</script>

<br/>

<div class="user_action">
  <a href="javascript:void(null)" id="add_user" alt="<?=lang('add_user')?>" ><img src="<?=base_url()?>img/icons/Create.png" title="<?=lang('add_user')?>" /></a>
  &nbsp; 
  <a href="javascript:void(null)" id="edit_user" alt="<?=lang('edit_user')?>" ><img src="<?=base_url()?>img/icons/Edit.png" title="<?=lang('edit_user')?>" /></a>
  &nbsp;  &nbsp;
  
  <a href="javascript:void(null)" id="mailto_user" alt="<?=lang('mailto_user')?>" ><img src="<?=base_url()?>img/icons/Mail.png" title="<?=lang('mailto_user')?>" /></a>
  
</div>

<br/>
<table id="table_users_all" width='100%' class='table_sorter table_pager' cellpadding=3px cellspacing=0>
  <thead>    
    <th>ID</th>
    <th><?=lang('username')?></th>
    <th>E-mail</th>
    <th><?=lang('registration_date')?></th>
    <th>IP</th>
    <th><?=lang('status')?></th>
    <th><?=lang('gender')?></th>
    <th><?=lang('look_for')?></th>
    <th><?=lang('birthdate')?> (<?=lang('age')?>)</th>
    <th><?=lang('state')?></th>
    <th><?=lang('zip_code')?></th>    
    <th><?=lang('affiliate')?></th>
    <th><?=lang('last_visit')?></th>    
  </thead>
    <tbody>
    <?php 
      $this->load->view('users/all_users_list');
    ?>  
    </tbody>
</table>

<div id="pager" class="pager">
	<form>
		<img src="<?=base_url()?>css/tablesorter/first.png" alt=" << " class="first">        
		<img src="<?=base_url()?>css/tablesorter/prev.png" alt=" < " class="prev">    
        
		<input class="pagedisplay ui-widget-content ui-corner-all" style='width:50px;' type="text">
        <select class="pagesize ui-widget-content ui-corner-all">
			<option selected="selected" value="5">5</option>
            <option value="20">10</option>
			<option value="20">20</option>
			<option value="30">30</option>
			<option value="40">40</option>
		</select>
        
		<img src="<?=base_url()?>css/tablesorter/next.png" alt=" > " class="next">
		<img src="<?=base_url()?>css/tablesorter/last.png" alt=" >>  " class="last">		
   	</form>
</div>
<br/>
<br/>

<br/>
<div id='response'></div>

<a href="<?=LINK_URL?>users" ><< <?php echo lang('users');?></a>

<div id="dialog-user" class="hide" title="<?php echo lang('term_user'); ?>">

</div>

<input type="hidden" id="selected_user_id" />

<?php 
      $this->load->view('users/dialog_add_edit');
      
      $this->load->view('users/dialog_mailto_user');
?>